import { uploadType, regularRule } from '@/utils/util'
const stateDicData = [
	{ label: '未完成', value: '0', type: 'danger' },
	{ label: '进行中', value: '1', type: 'info' },
	{ label: '已完成', value: '2', type: 'success' },
]
export const reformFormConfig: any = {
	inline: false,
	labelPosition: 'left',
	labelWidth: '180px',
	showBtn: true,
	column: [
		// 家庭床位改造
		{
			type: 'DividerHtml',
			custome: 'divider',
			position: 'center',
			modelValue: '家庭床位改造',
			span: 24,
		},
		{
			type: 'DividerHtml',
			modelValue: '家庭床位改造',
			span: 24,
		},
		{
			label: '改造单位名称',
			prop: 'remouldUnitName',
			type: 'text',
			maxlength: '50',
			showWordLimit: true,
			span: 12,
			rules: [{ required: true, message: '请输入改造单位名称' }],
		},
		{
			label: '改造单位统一信用代码',
			prop: 'remouldCreditCode',
			type: 'text',
			maxlength: '50',
			showWordLimit: true,
			span: 12,
			rules: [
				{ required: true, message: '请输入改造单位统一信用代码' },
				{ pattern: regularRule.code, message: '请输入正确改造单位统一信用代码' },
			],
		},
		{
			label: '改造时间',
			prop: 'remouldTime',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 12,
			rules: [{ required: true, message: '请输入改造时间' }],
		},
		{
			label: '改造人',
			prop: 'remouldName',
			type: 'text',
			maxlength: '20',
			showWordLimit: true,
			span: 12,
			rules: [{ required: true, message: '请输入改造人名称' }],
		},
		{
			label: '改造实际金额（元）',
			prop: 'actualAmount',
			type: 'text',
			append: '元',
			rules: [
				{ required: true, message: '请输入改造实际金额' },
				{ validator: regularRule.number, message: '请输入正确的改造实际金额' },
			],
			span: 12,
		},
		{
			label: '改造标准金额（元）',
			prop: 'standardAmount',
			type: 'text',
			append: '元',
			rules: [
				{ required: true, message: '请输入改造标准金额' },
				{ validator: regularRule.number, message: '请输入正确的改造标准金额' },
			],
			span: 12,
		},
		{
			label: '改造前后对比档案',
			prop: 'comparison',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'left',
			showFileList: true,
			changeField: true,
			limit: 1,
			multiple: true,
			span: 24,
			rules: [{ required: true, message: '请输入改造前后对比档案' }],
		},
		{
			label: '改造档案状态',
			prop: 'remouldState',
			propName: 'remouldStateLabel',
			type: 'select',
			dicData: stateDicData,
			filterKey: 'value',
			multiple: false,
			span: 12,
			rules: [{ required: true, message: '请输入签约档案状态' }],
		},
	],
}
